package com.market.plus.core.dto;

import java.util.Date;
import java.util.List;

import com.googlecode.simpleobjectassembler.annotation.EntityDto;

@EntityDto(id="id")
public class NewsDto {

   private Long id;

   private String title;

   private String content;

   private Integer newsType;

   private Integer totalComments;

   private String createdUser;

   private Date createdDate;

   private String modifyedUser;

   private Date modifyedDate;

   private ParticipantDto participant;

   private String guid;

   private List<ContentFileDto> contentFiles;

   private List<CommentDto> comments;

   public NewsDto() {
      totalComments = 0;
   }

   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public String getCreatedUser() {
      return createdUser;
   }

   public void setCreatedUser(String createdUser) {
      this.createdUser = createdUser;
   }

   public Date getCreatedDate() {
      return createdDate;
   }

   public void setCreatedDate(Date createdDate) {
      this.createdDate = createdDate;
   }

   public String getModifyedUser() {
      return modifyedUser;
   }

   public void setModifyedUser(String modifyedUser) {
      this.modifyedUser = modifyedUser;
   }

   public Date getModifyedDate() {
      return modifyedDate;
   }

   public void setModifyedDate(Date modifyedDate) {
      this.modifyedDate = modifyedDate;
   }

   public String getTitle() {
      return title;
   }

   public void setTitle(String title) {
      this.title = title;
   }

   public String getContent() {
      return content;
   }

   public void setContent(String content) {
      this.content = content;
   }

   public Integer getNewsType() {
      return newsType;
   }

   public void setNewsType(Integer newsType) {
      this.newsType = newsType;
   }

   public List<ContentFileDto> getContentFiles() {
      return contentFiles;
   }

   public void setContentFiles(List<ContentFileDto> contentFiles) {
      this.contentFiles = contentFiles;
   }

   public ParticipantDto getParticipant() {
      return participant;
   }

   public void setParticipant(ParticipantDto participant) {
      this.participant = participant;
   }

   public String getGuid() {
      return guid;
   }

   public void setGuid(String guid) {
      this.guid = guid;
   }

   public List<CommentDto> getComments() {
      return comments;
   }

   public void setComments(List<CommentDto> comments) {
      this.comments = comments;
   }

   public Integer getTotalComments() {
      return totalComments;
   }

   public void setTotalComments(Integer totalComments) {
      this.totalComments = totalComments;
   }

   @Override
   public boolean equals(Object obj) {
      NewsDto propertyCompare = (NewsDto) obj;
      boolean hasResult = (this.getId()!=null && propertyCompare.getId()!=null && this.getId().longValue() == propertyCompare.getId().longValue());
      hasResult = hasResult || (this.getGuid()!=null && this.getGuid().equals(propertyCompare.getGuid()));
      return hasResult;
   }
}
